package com.andsys;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

/**
 * Created by ezheng on 2017/10/28.
 */
@RestController
public class HelloController {


    @Autowired
    private GirlProperties girlProperties;

    @GetMapping(value="/welcome")
    public String welCome(){
        return "dear, welcome to my weapp.";
    }



    @GetMapping(value="/say/{id}")
    public String say(@PathVariable("id") Integer id){
        return "Hello Sping Boot.cupSize:"+ girlProperties.getCupSize()+"id:"+id;
    }
    @GetMapping(value="/parm")
    public String parm(@RequestParam(value = "id",required = false , defaultValue = "0")  Integer myId){
        return "myId:"+ myId;
    }

    @GetMapping(value={"/two","second"})
    public String second(){
        return "Hello Sping Boot.cupSize:"+ girlProperties.getCupSize();
    }


}
